﻿#include"Collision.h"
#include<Windows.h>
using namespace std;

#ifdef WIN32                                                                                                                            // If We're Under MSVC
#pragma comment(lib, "OpenGL32.lib")                                                                            // We're Telling The Linker To Look For The OpenGL32.lib
#pragma comment(lib, "GLU32.lib")                                                                                       // The GLu32.lib Library...
#pragma comment(lib, "SDLmain.lib")                                                                                     // The SDLmain.lib And
#pragma comment(lib, "SDL.lib")                                                                                         // The SDL.lib Libraries
#endif  
 
/*************************************************************************************/

int main(int argc, char * argv[]){

	Collision collide;

     if(SDL_Init(SDL_INIT_VIDEO) < 0)
     { 
		//nie uda³o siê
          fprintf(stderr, "operation failed: %s\n", SDL_GetError());
          collide.render.quit(1);
     }
	collide.render.info = SDL_GetVideoInfo(); //info o ekranie
	collide.render.SCREEN_WIDTH = collide.render.info->current_w; //szerokoæ ekranu
	collide.render.SCREEN_HEIGHT = collide.render.info->current_h; //wysokoæ ekranu
	_putenv_s("SDL_VIDEO_WINDOW_POS", "10,30"); //zmiana zmiennej rodowiskowej - SDL_VIDEO_WINDOW - pozycja okna na ekranie
	MoveWindow( GetConsoleWindow(), 820, 0, 700, 350, true ); //hwnd,x,y,szerokosc,wysokosc
	//SDL_VIDEO_WINDOW_POS = "center"; // okno w centrum ekranu

	collide.render.InitOpenGLAndSDL(); //tworzenie okna i inicjalizacja OpenGLa

	SDL_ShowCursor(SDL_DISABLE);

	//g³ówna pêtla
	while(collide.render.isrunning)     
	{
		collide.HandleEvents();      //zdarzenia
          collide.render.RenderScene();       //odwie¿anie obrazu
		SDL_Delay(5);	//wait for some time
	}
	SDL_Quit();
	return 0;
}

/**************************************************************************************/
